# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.File.V1.Model.NetworkConfig do
  @moduledoc """
  Network configuration for the instance.

  ## Attributes

  *   `connectMode` (*type:* `String.t`, *default:* `nil`) - The network connect mode of the Filestore instance. If not provided, the connect mode defaults to DIRECT_PEERING.
  *   `ipAddresses` (*type:* `list(String.t)`, *default:* `nil`) - Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
  *   `modes` (*type:* `list(String.t)`, *default:* `nil`) - Internet protocol versions for which the instance has IP addresses assigned. For this version, only MODE_IPV4 is supported.
  *   `network` (*type:* `String.t`, *default:* `nil`) - The name of the Google Compute Engine [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the instance is connected.
  *   `reservedIpRange` (*type:* `String.t`, *default:* `nil`) - Optional, reserved_ip_range can have one of the following two types of values. * CIDR range value when using DIRECT_PEERING connect mode. * [Allocated IP address range](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address) when using PRIVATE_SERVICE_ACCESS connect mode. When the name of an allocated IP address range is specified, it must be one of the ranges associated with the private service access connection. When specified as a direct CIDR value, it must be a /29 CIDR block for Basic tier, a /24 CIDR block for High Scale tier, or a /26 CIDR block for Enterprise tier in one of the [internal IP address ranges](https://www.arin.net/reference/research/statistics/address_filters/) that identifies the range of IP addresses reserved for this instance. For example, 10.0.0.0/29, 192.168.0.0/24 or 192.168.0.0/26, respectively. The range you specify can't overlap with either existing subnets or assigned IP address ranges for other Filestore instances in the selected VPC network.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :connectMode => String.t() | nil,
          :ipAddresses => list(String.t()) | nil,
          :modes => list(String.t()) | nil,
          :network => String.t() | nil,
          :reservedIpRange => String.t() | nil
        }

  field(:connectMode)
  field(:ipAddresses, type: :list)
  field(:modes, type: :list)
  field(:network)
  field(:reservedIpRange)
end

defimpl Poison.Decoder, for: GoogleApi.File.V1.Model.NetworkConfig do
  def decode(value, options) do
    GoogleApi.File.V1.Model.NetworkConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.File.V1.Model.NetworkConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
